const mongoose = require("mongoose");
const deptSchema = mongoose.Schema({
  deptName: String,
  userId: String,
  userName: String,
  userEmail: String,
  parentId: [mongoose.Types.ObjectId],
  updateTime: {
    type: Date,
    default: Date.now(),
  },
  createTime: {
    type: Date,
    default: Date.now(),
  },
});

// mongoose.model 如果第三个参数不加，那么第一个参数在创建集合的时候会自动加s
module.exports = mongoose.model("depts", deptSchema);
